package ionio.cscw.game;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;

public class ListCheck {
	
	ArrayList<String> wordList = new ArrayList<String>(20);
	
	public ListCheck(URL url) {
		try{
			File file=new File(url.toURI());
			BufferedReader breader=new BufferedReader(new FileReader(file));
			String currentWord;
			while((currentWord=breader.readLine())!=null) {
				System.out.println(currentWord+"#");
				wordList.add(currentWord);
			}
		}catch(Exception ex) {
			ex.printStackTrace();
		}		
	}
	public boolean checkWord(String userWord){
		for(String word : wordList){
			if(word.equalsIgnoreCase(userWord)){
				return false;
			}
		}
		return true;
	}

}
